﻿<!DOCTYPE html>
<html>

<head>

    <!--<meta charset="utf-8">-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>吐槽大会 | 登录</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
    <!-- <link rel="shortcut icon" href="favicon.ico"> -->

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

</head>
<style type="text/css">
    .iphone{
    background: #B0A7A2;
    width: 50%;
    float: left;
    color: #fff;
    position: absolute;
    overflow: hidden;
    left: 0px;
    padding:15px 0;
    bottom: 0px;
    border-radius: 0 0 0 10px
    }
    .iphone :hover{

    }
    .andrion{
    background: #B0A7A2;
    padding: 15px 0;
    width: 50%;
    float: left;
    color: #fff;
    position: absolute;
    overflow: hidden;
    right: 0px;
    bottom: 0px;
    border-radius: 0 0 10px 0
    }
    .yin{
        background-image: url(./img/tk.png);
    }
</style>

<body onkeydown="keyLogin();" style="background-image: url(./img/background.png);background-size:100% 100%;height:100%;overflow-y: hidden;">

    <div class="middle-box text-center loginscreen animated fadeInDown">
            <div style="background:#FDFDFD;padding:10px 30px;border-radius: 10px;overflow: hidden;">
                   <h3 style="width:100%;float: left;text-align: center;color: #8D8A88;padding: 30px 20px 10px 10px;">欢迎登陆  |  吐槽大会服务系统</h3>
                <div class="form-group" style="padding: 0 0">
                    <input style="border-radius: 50px" name="adminName" class="form-control" placeholder="请输入手机号">
                </div>
                <div class="form-group" style="padding: 0 0;position:relative;">
                    <input style="border-radius: 50px" name="adminPass" type="password" class="form-control" placeholder="请输入密码" maxlength="30" >
                </div>
                <!-- <a href="index.html"> -->
                <button id="loginone" onclick="login()" class="btn btn-primary block full-width m-b" style="border-radius: 50px">登录</button>
            <!-- </a> -->
                <!-- <p style="line-height: 50px;height: 100px"><small>没有账号?</small> <a href="#"><small>免费注册</small></a></p> -->
                <div>
                </div>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script src="js/jquery-3.1.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/other.js"></script>
    <script type="text/javascript">
    function keyLogin(){ 
    if (event.keyCode==13)  //回车键的键值为13 
       document.getElementById("loginone").click(); //调用登录按钮的登录事件 
    }
        function login(){
            var adminName=$('input[name=adminName]').val();
            var adminPass=$('input[name=adminPass]').val();
            $.ajax({
                url:httpUrl+'login',
                data:'{phone:"'+adminName+'",adminPass:"'+adminPass+'"}',
                contentType: 'application/json;charset=utf-8',
                dataType:'json',
                type:'post',
                success:function(res){
                    if(res.code==200&&res.state==0){
                        localStorage.setItem("userId",JSON.stringify(res.data.adminId));
                        localStorage.setItem("userName",JSON.stringify(res.data.adminName));
                        location.href="homePage.html";
                    }else{
                        alert(res.message);
                        $("input[name=pwd]").val("");
                    }
                }
            })
            // return false;

        }


    </script>

</body>

</html>
